home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-03-27 | 6.8 KB | 255 lines | [TEXT/PJMM] |
- unit ConfigDialog;
-
- interface
-
-
- uses
- Globals, HelloTabby, NewFileUtils;
-
- procedure HandleDialog (TheVers: str255);
-
-
- implementation
-
- { ------------------------------------------------------ }
-
- procedure HandleDialog;
-
- var
- ForwardName, FREQName, AgentName, OptionStr: str255;
- ItemHit, itemType: integer;
- dispRect: Rect;
- itemHandle: Handle;
- thisButton: ControlHandle;
- DialogPointer: DialogPtr;
-
- begin
- InitCursor;
- DialogPointer := GetNewDialog(1002, nil, POINTER(-1)); {IM I-413}
- SetPort(DialogPointer);
- FrameDItem(DialogPointer, Ok);
- DrawDialog(DialogPointer);
-
- NextLaunch := GetString(500)^^; { Get next launch string from resource }
- getDItem(DialogPointer, 3, itemType, itemHandle, dispRect);
- SetIText(Handle(itemHandle), NextLaunch);
-
- OptionStr := GetString(501)^^;
- uprString(OptionStr, false);
-
- ForwardName := GetString(502)^^; { Get file forward string from resource }
- getDItem(DialogPointer, 10, itemType, itemHandle, dispRect);
- SetIText(Handle(itemHandle), ForwardName);
-
- FREQName := GetString(503)^^;
- getDItem(DialogPointer, 19, itemType, itemHandle, dispRect);
- SetIText(Handle(itemHandle), FREQName);
-
- AgentName := GetString(504)^^;
- getDItem(DialogPointer, 20, itemType, itemHandle, dispRect);
- SetIText(Handle(itemHandle), AgentName);
-
- TextFont(Geneva);
- TextSize(9);
- ForeColor(redColor);
- getDItem(DialogPointer, 4, itemType, itemHandle, dispRect);
- SetIText(Handle(itemHandle), TheVers);
-
- ForeColor(blackColor);
- SetDAFont(0);
- TextFont(0);
- TextSize(0);
-
- getDItem(DialogPointer, 5, itemType, itemHandle, dispRect); { Message to Sysop }
- thisButton := ControlHandle(itemHandle);
- if (OptionStr[1] = 'Y') then
- SetCtlValue(thisButton, 1)
- else
- SetCtlValue(thisButton, 0);
-
- getDItem(DialogPointer, 6, itemType, itemHandle, dispRect); { No Password for list }
- thisButton := ControlHandle(itemHandle);
- if (OptionStr[2] = 'Y') then
- SetCtlValue(thisButton, 1)
- else
- SetCtlValue(thisButton, 0);
-
- getDItem(DialogPointer, 7, itemType, itemHandle, dispRect); { Write to Tabby Log }
- thisButton := ControlHandle(itemHandle);
- if (OptionStr[3] = 'Y') then
- SetCtlValue(thisButton, 1)
- else
- SetCtlValue(thisButton, 0);
-
- getDItem(DialogPointer, 8, itemType, itemHandle, dispRect); { Write to Forward Log }
- thisButton := ControlHandle(itemHandle);
- if (OptionStr[4] = 'Y') then
- SetCtlValue(thisButton, 1)
- else
- SetCtlValue(thisButton, 0);
-
- getDItem(DialogPointer, 9, itemType, itemHandle, dispRect); { Delete Forwarded Files }
- thisButton := ControlHandle(itemHandle);
- if (OptionStr[5] = 'Y') then
- SetCtlValue(thisButton, 1)
- else
- SetCtlValue(thisButton, 0);
-
- getDItem(DialogPointer, 21, itemType, itemHandle, dispRect); { Write to FREQ Log }
- thisButton := ControlHandle(itemHandle);
- if (OptionStr[6] = 'Y') then
- SetCtlValue(thisButton, 1)
- else
- SetCtlValue(thisButton, 0);
-
- if StillDown then
- repeat
- until not Button;
-
- repeat
- ModalDialog(nil, ItemHit);
-
- case ItemHit of
-
- 1: { OK button hit -- save resources }
- begin
- getDItem(DialogPointer, 3, itemType, itemHandle, dispRect);
- GetIText(Handle(itemHandle), NextLaunch);
- RmveResource(GetResource('STR ', 500));
- UpdateResFile(CurrentResFile);
- AddResource(Handle(NewString(NextLaunch)), 'STR ', 500, 'Next Launch');
-
- { format of OptionStr is: MsgToSysop, ListOK, TabbyLog }
-
- RmveResource(GetResource('STR ', 501));
- UpdateResFile(CurrentResFile);
- AddResource(Handle(NewString(OptionStr)), 'STR ', 501, 'Options');
-
- getDItem(DialogPointer, 10, itemType, itemHandle, dispRect);
- GetIText(Handle(itemHandle), ForwardName);
- RmveResource(GetResource('STR ', 502));
- UpdateResFile(CurrentResFile);
- AddResource(Handle(NewString(ForwardName)), 'STR ', 502, 'File Forward Name');
-
- getDItem(DialogPointer, 19, itemType, itemHandle, dispRect);
- GetIText(Handle(itemHandle), FREQName);
- RmveResource(GetResource('STR ', 503));
- UpdateResFile(CurrentResFile);
- AddResource(Handle(NewString(FREQName)), 'STR ', 503, 'FREQ Name');
-
- getDItem(DialogPointer, 20, itemType, itemHandle, dispRect);
- GetIText(Handle(itemHandle), AgentName);
- RmveResource(GetResource('STR ', 504));
- UpdateResFile(CurrentResFile);
- AddResource(Handle(NewString(AgentName)), 'STR ', 504, 'Remote Name');
-
- end;
-
- 5: { Message to Sysop button hit }
- begin
- getDItem(DialogPointer, 5, itemType, itemHandle, dispRect);
- thisButton := ControlHandle(itemHandle);
- if OptionStr[1] = 'Y' then
- begin
- OptionStr[1] := 'N';
- SetCtlValue(thisButton, 0)
- end
- else
- begin
- OptionStr[1] := 'Y';
- SetCtlValue(thisButton, 1)
- end
- end;
-
- 6: { List Without Password button hit }
- begin
- getDItem(DialogPointer, 6, itemType, itemHandle, dispRect);
- thisButton := ControlHandle(itemHandle);
- if OptionStr[2] = 'Y' then
- begin
- OptionStr[2] := 'N';
- SetCtlValue(thisButton, 0)
- end
- else
- begin
- OptionStr[2] := 'Y';
- SetCtlValue(thisButton, 1)
- end
- end;
-
- 7: { Tabby Log button hit }
- begin
- getDItem(DialogPointer, 7, itemType, itemHandle, dispRect);
- thisButton := ControlHandle(itemHandle);
- if OptionStr[3] = 'Y' then
- begin
- OptionStr[3] := 'N';
- SetCtlValue(thisButton, 0)
- end
- else
- begin
- OptionStr[3] := 'Y';
- SetCtlValue(thisButton, 1)
- end
- end;
-
- 8: { Forward Log button hit }
- begin
- getDItem(DialogPointer, 8, itemType, itemHandle, dispRect);
- thisButton := ControlHandle(itemHandle);
- if OptionStr[4] = 'Y' then
- begin
- OptionStr[4] := 'N';
- SetCtlValue(thisButton, 0);
- end
- else
- begin
- OptionStr[4] := 'Y';
- SetCtlValue(thisButton, 1)
- end
- end;
-
- 9: { Delete Forwarded Files button hit }
- begin
- getDItem(DialogPointer, 9, itemType, itemHandle, dispRect);
- thisButton := ControlHandle(itemHandle);
- if OptionStr[5] = 'Y' then
- begin
- OptionStr[5] := 'N';
- SetCtlValue(thisButton, 0);
- end
- else
- begin
- OptionStr[5] := 'Y';
- SetCtlValue(thisButton, 1)
- end
- end;
-
- 21: { Write to FREQ Log button hit }
- begin
- getDItem(DialogPointer, 21, itemType, itemHandle, dispRect);
- thisButton := ControlHandle(itemHandle);
- if OptionStr[6] = 'Y' then
- begin
- OptionStr[6] := 'N';
- SetCtlValue(thisButton, 0);
- end
- else
- begin
- OptionStr[6] := 'Y';
- SetCtlValue(thisButton, 1)
- end
- end;
-
- otherwise
- ;
-
- end;
-
- until (ItemHit = 1) or (ItemHit = 2);
-
- NextLaunch := '';
-
- DisposDialog(DialogPointer)
- end;
- end. { Unit }